#include<sys/types.h>
#include<sys/ipc.h>
#include<sys/msg.h>
#include<stdio.h>

struct msgbuf
{
    long type;//类型
    int groupid;
    int appid;
    char buf[1024];
};

int main()
{
    int msgid;
    msgid=msgget(0x1000,IPC_CREAT | 0777);
    struct msgbuf mb={1,1, 1,"hello world"};
    int ret;
    ret=msgsnd(msgid,&mb,sizeof(struct msgbuf)-sizeof(long),0);
    //这里的长度不包括类型的大小
    
    return 0;
}
